<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>机构列表</title>
		<link type="text/css" rel="stylesheet" href="<%=basePath%><s:property value="#session.themeStyle.mainCss" default="Skin/PM/LightBlue/main.css"/>" />
		<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/store.js"></script>
		<style type="text/css">
			.trStyle td{
				text-align: center;
			}
			.buttonLab{
				cursor: pointer;
				background-image: url('<%=basePath %>images/main/button_bg.png');
				width: 80px; 
				height: 22px;
				color:white;
			}
		</style>
		<style type="text/css">
	.aBut20{
				height: 20px;
				line-height: 20px;
				background-image: url("<%=basePath %>/images/but_bg_20_1.png");
				background-repeat: repeat-x;
				border: 1px #4da1e5 solid;
				display:inline-block;
				background-color: #74b6ec;
				cursor: pointer;
				text-align: center;
				font-size: 12px;
				font-family: '宋体';
			}
			.aBut20:hover{
				background-image: url("<%=basePath %>/images/but_bg_20_2.png");
			}
			.aBut20:active{
				background-image: url("<%=basePath %>/images/but_bg_20_3.png");
			}
			.aBut27{
				height: 27px;
				line-height: 27px;
				background-image: url("<%=basePath %>/images/but_bg_27_1.png");
				background-repeat: repeat-x;
				border: 1px #88c7ef solid;
				display:inline-block;
				background-color: #b6ddf7;
				cursor: pointer;
				text-align: center;
				font-size: 12px;
				font-family: '宋体';
			}
			.aBut27:hover{
				background-image: url("<%=basePath %>/images/but_bg_27_2.png");
			}
			.aBut27:active{
				background-image: url("<%=basePath %>/images/but_bg_27_3.png");
			}
			.aBut35{
				height: 35px;
				line-height: 35px;
				background-image: url("<%=basePath %>/images/but_bg_35_1.png");
				background-repeat: repeat-x;
				border: 1px #88c7ef solid;
				display:inline-block;
				background-color: #b6ddf7;
				cursor: pointer;
				text-align: center;
				font-size: 12px;
				font-family: '宋体';
			}
			.aBut35:hover{
				background-image: url("<%=basePath %>/images/but_bg_35_2.png");
			}
			.aBut35:active{
				background-image: url("<%=basePath %>/images/but_bg_35_3.png");
			}
	</style>
	</head>
	<script language="javascript">
	function add() {
		var info =  $("input[name='listCheck']:checked");
		var ids = "";
		for(var i=0;i<info.length;i++){
			if(i==0){
				dis = info[i].id;
			}else{
				dis = dis + "," + info[i].id;
			}
		}
		window.returnValue=dis;
    	window.close();
	}
	$(document).ready(function() {
		var roleIds = $("#roleIds").val();
		if(roleIds!=""){
			var ck =  $("input[name='listCheck']");
			for(var i=0;i<ck.length;i++){
				for(var j=0;j<roleIds.length;j++){
					if(ck[i].id==roleIds[j]){
						$(ck[i]).attr("checked","checked");
					}	
				}
			}
		}
	});
	</script>
<body>
<div style="margin-left: 8px;margin-right: 8px;border-bottom: 2px #6DA14F solid;height: 24px;margin-top: 0px;line-height: 24px;">
			当前位置：系统管理 &nbsp;&gt;&gt;&nbsp;权限管理 &nbsp;&gt;&gt;&nbsp;用户设置
	</div>
	<div class="tabBlock">
		<a class="but28" style="width: 120px;color: #3893e1;" onClick="add();" >保存</a>&nbsp;&nbsp;
		<input type="hidden" id="roleIds" value='<s:property value="roleIds"/>' />
			<div class="dataGrid">
				<table>
					<tr>
						<th width="22">
							<input name="checkAll" type="checkbox" onClick="onCheckAll()" />
						</th>
						<th width="400" nowrap="nowrap">
							角色名称
						</th>						
					</tr>
					<s:iterator value="roleList" status="st">
						<tr class="trStyle">
							<td>
								<input name="listCheck" type="checkbox" id='<s:property value="pkId" />' />
							</td>
							<td>
								<s:property value="name" />
							</td>							
						</tr>
					</s:iterator>
				</table>
			</div>
	</div>
</body>
</html>